package com.xebest.web.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xebest.common.enums.erp.aftersales.VenAfterSaleReasonEnum;
import com.xebest.common.enums.erp.aftersales.VenAfterSaleStatusEnum;
import com.xebest.util.SysSetBeanUtils;
import com.xebest.web.controller.export.XeVenAfterSaleExportDTO;
import com.xebest.web.form.XeVenAfterSaleQueryForm;
import com.xebest.web.mapper.read.XeVenAfterSaleCenterExportMapper;
import com.xebest.web.service.XeVenAfterSaleCenterExportService;


/**
 * 客服中心导出处理
 * @desc: xebest-erp  
 * @author: 赵盼飞  
 * @createTime: 2017年6月27日 下午5:30:00  
 * @history:  
 * @version: v1.0
 */
@Service
public class XeVenAfterSaleCenterExportServiceImpl implements XeVenAfterSaleCenterExportService{
	
	@Autowired
	private XeVenAfterSaleCenterExportMapper afterSaleCenterExportMapper;//客服中心

	/**
	 * 导出售后单列表
	 */
	@Override
	public List<XeVenAfterSaleExportDTO> queryAfterSaleExportList(XeVenAfterSaleQueryForm form) {
		  
		List<XeVenAfterSaleExportDTO> afterSaleList = afterSaleCenterExportMapper.queryAfterSaleExportList(form);
		for(XeVenAfterSaleExportDTO afterSale : afterSaleList){
			SysSetBeanUtils.codeReversionStr("afterSaleStatus", afterSale, VenAfterSaleStatusEnum.class);
			SysSetBeanUtils.codeReversionStr("afterSaleReason", afterSale, VenAfterSaleReasonEnum.class);
		}
		return afterSaleList;  
	}

	@Override
	public List<XeVenAfterSaleExportDTO> queryAfterSaleExportDetail(XeVenAfterSaleQueryForm form) {
		List<XeVenAfterSaleExportDTO> afterSaleDetail = afterSaleCenterExportMapper.queryAfterSaleExportDetail(form);
		for(XeVenAfterSaleExportDTO afterSale : afterSaleDetail){
			SysSetBeanUtils.codeReversionStr("afterSaleStatus", afterSale, VenAfterSaleStatusEnum.class);
			SysSetBeanUtils.codeReversionStr("afterSaleReason", afterSale, VenAfterSaleReasonEnum.class);
		}
		return afterSaleDetail;  
	}
	
	
}
